package org.mtmi.ui.controls.edits;

import org.mtmi.ui.IMG;
import org.mtmi.ui.controls.Keyboard;
import org.mtmi.ui.drawables.IDrawable;

public class RemoveKeyboardOctaveAction extends AddKeyboardOctaveAction
{
	
	public RemoveKeyboardOctaveAction( Keyboard k ) {
		super( k );
	}
	
	@Override
	public IDrawable getImage() {
		return IMG.GetD( "icons/octave_remove.png" );
	}

	@Override
	protected boolean isEnabled( Keyboard k ) {
		return k!=null && k.getOctaveCount()>1;
	}

	@Override
	public void run( Keyboard k ) {
		k.setOctaveCount( k.getOctaveCount()-1 );
	}
}
